<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<title>聊天记录列表</title>
<link th:replace="common/header"/>
<link rel="stylesheet" th:href="@{/css/tip.css}"/>
<script type="text/javascript" th:src="@{/js/layer/tip.js}"></script>
</head>
<body class="no-skin">
    <div th:replace="common/top"></div>
	<div class="main-container ace-save-state" id="main-container">
		<div th:replace="common/menu"></div>
		<div class="main-content">
			<div class="main-content-inner">
				<div th:replace="common/title"></div>
				<div class="page-content">
					<div th:replace="common/skin"></div>
					<div class="row">
						<div class="col-xs-12">
							<!-- PAGE CONTENT BEGINS -->
							<h3 class="header smaller lighter blue"><i class="fa fa-list" aria-hidden="true"></i>聊天记录列表</h3>
							<form id="form" name="form" th:action="@{/chatRecord/getall}" th:method="post" th:object="${chatRecordForm}">
								<div class="row-fluid">
									<!--PAGE CONTENT BEGINS HERE-->
									<div class="span12">
										<table style="width:100%" border="0">
											<tbody>
												<tr>
													<th style="width: 50px;">关键字:</th>
													<td style="width: 200px;">
														<input type="text" name="content" id="content" class="input_fix" placeholder="关键字" th:value="*{content}" maxlength="50"/>
													</td>
													<th style="width: 50px;">聊天类型:</th>
													<td style="width: 200px;">
														<select title="" th:field="*{type}" id="type" name="type" class="input_fix">
															<option value="">全部</option>
															<option th:each="type : ${T(xyz.ibenben.zhongdian.system.entity.enums.ChatTypeEnum).values()}" th:value="${type}" th:text="${type.text}"></option>
														</select>
													</td>
													<th style="width: 50px;">发送者:</th>
													<td style="width: 200px;">
														<select title="" th:field="*{fromId}" id="fromId" name="fromId" class="input_fix">
															<option value="">全部</option>
															<option th:each="user : ${userList}"
																th:value="${user.id}" th:text="${user.username}">山东</option>
														</select>
													</td>
													<th style="width: 50px;">接收者:</th>
													<td style="width: 200px;">
														<select title="" th:field="*{toId}" id="toId" name="toId" class="input_fix">
															<option value="">全部</option>
															<option th:each="user : ${userList}"
																th:value="${user.id}" th:text="${user.username}">山东</option>
														</select>
													</td>
													<td style="width:120px;">
														<button class="btn btn-info" style="float: right;" type="button" onclick="pagechange(1);"><i class="fa fa-search" aria-hidden="true"></i>查询</button>
													</td>
												</tr>
											</tbody>
										</table>
									</div>
								</div>
								<table class="table">
									<thead>
										<tr>
											<td>发送者</td>
											<td>接收者</td>
											<td>发送内容</td>
											<td>发送时间</td>
											<td>消息类型</td>
											<td>操作</td>
										</tr>
									</thead>
									<tbody>
									<tr th:each="chat: ${chatRecordList}">
										<td th:text="${chat.fromUserName}"></td>
										<td th:text="${chat.toUserName}">doudou</td>
										<td th:text="${chat.content}">1-1-1-1</td>
										<td th:text="${#dates.format(chat.sendTime, 'yyyy年MM月dd日')}">2017-09-09</td>
										<td th:text="${chat.type.text}">海尔家园</td>
										<td>
											<a href="#" shiro:hasPermission="/chatRecord/view" class="btn btn-primary btn-minier" th:href="@{'/chatRecord/' + ${chat.id} + '/view'}" th:text="查看详情">查看详情</a>
										</td>
									</tr>
									</tbody>
									<tfoot>
										<tr>
											<td colspan="6">
												<div class="row-fluid" th:replace="common/page"></div>
											</td>
										</tr>
									</tfoot>
								</table>
							</form>
							<!-- PAGE CONTENT ENDS -->
						</div><!-- /.col -->
					</div><!-- /.row -->
				</div><!-- /.page-content -->
			</div>
		</div><!-- /.main-content -->
		<div th:replace="common/footer"></div>
	</div><!-- /.main-container -->
	<div th:replace="common/buttom"></div>
	<div th:replace="common/layer"></div>
</body>
</html>
